-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for app:enable in case of not valid/not existing enterprise key #36399
Conversation
1246c86
to
078ed73
Compare
https://drone.owncloud.com/owncloud/core/21265/3/6
It still needs to work for the community edition, when there is no |
078ed73
to
0d837cd
Compare
0d837cd
to
b3353dd
Compare
@phil-davis @micbar better now? |
03a177b
to
ccef819
Compare
5750a1c
to
5185111
Compare
@micbar is this progressing? |
5185111
to
cb5b6b4
Compare
df63431
to
e2442a6
Compare
suppress PhanUndeclaredClassMethod for \OCA\Enterprise_Key\EnterpriseKey Ignore OCA\Enterprise_Key\EnterpriseKey not found for phpstan
e2442a6
to
6e703aa
Compare
Codecov Report
@@ Coverage Diff @@
## master #36399 +/- ##
============================================
- Coverage 64.68% 64.68% -0.01%
- Complexity 19071 19074 +3
============================================
Files 1268 1268
Lines 74522 74528 +6
Branches 1312 1312
============================================
+ Hits 48207 48209 +2
- Misses 25930 25934 +4
Partials 385 385
Continue to review full report at Codecov.
|
And adjusted the unit test so it knows about the new param to the constructor. |
PHpstan fails because the code of Enterprise Key is not available. |
I "fixed" that by making it ignore that - phpstan CI is passing. |
I added a changelog. I think this is ready for review. There are existing We are not easily able to get ourselves an enterprise app and the enterprise_key app etc during core CI. So this change will need manual testing during the release QA process. |
@@ -70,6 +76,16 @@ protected function execute(InputInterface $input, OutputInterface $output) { | |||
return 1; | |||
} | |||
|
|||
if (\OC_App::isEnabled('enterprise_key')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue we found now is that if you have the enterprise app enabled, but have an invalid enterprise key, and you are just trying to enable a non-enterprise app, then the app cannot be enabled. e.g. enabling the testing
app does not work.
If there is some way to check if the app being enabled is an Enterprise app, then this could be fixed by:
if (\OC_App::isEnterpriseApp($appId) && \OC_App::isEnabled('enterprise_key')) {
Description
This PR fixes the current behaviour of the
app:enable
occ command in case of not valid/not existing enterprise key.Related Issue
Motivation and Context
Currently, when running the
app:enable
occ command for enabling an enterprise app and the enterprise key is not valid/not existing, the command does not return any warning/error message. Still, the enterprise app stays disabled. Only when looking into the owncloud.log file one will see an error message about the invalid license key.How Has This Been Tested?
Manually, by: - disabling an enterprise app, - setting an invalid enteprise key, - trying to re-enable that enterprise app. Now, the
$appId cannot be enabled because of invalid enteprise key
message is shown.Implemented for both cases in case groups are/are not given as input to the command.
Types of changes
Checklist: